package ttts;
// BillingService.java
public class BillingService {
    public double calculateCallCost(int totalMinutes, int totalSeconds) {
        double cost = 0.0;

        int totalCallMinutes = totalMinutes + (totalSeconds > 0 ? 1 : 0); // 将通话时间的秒数向上进位到分钟

        if (totalCallMinutes <= 20) {
            cost = totalCallMinutes * 0.05;
        } else {
            cost = 1.00 + (totalCallMinutes - 20) * 0.10;
        }

        return cost;
    }
}

